<!doctype html>



  


<html class="theme-next pisces use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="flex,css布局," />





  <link rel="alternate" href="/atom.xml" title="前端-洋洋" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="flex测试工具
前言之前分享过Flex布局，一段时间没有用，忘得差不多了，恰逢我们的前端博客的诞生，在此记录并再次学习下；
布局方式首先,我们有表格布局。当不考虑语义并且利用一些适当的嵌套和其他技巧,我们可以用table建立具有一定功能的布局。
然后是现在大多数人都在使用的浮动布局。我们可以使用任何我们想用的元素,但浮动并不适用于初学者。表面上它看起来很基础,但背后复杂的功能可以使经验丰富的开发">
<meta property="og:type" content="article">
<meta property="og:title" content="Flex布局">
<meta property="og:url" content="http://html-js.site/2016/05/10/Flex布局/index.html">
<meta property="og:site_name" content="前端-洋洋">
<meta property="og:description" content="flex测试工具
前言之前分享过Flex布局，一段时间没有用，忘得差不多了，恰逢我们的前端博客的诞生，在此记录并再次学习下；
布局方式首先,我们有表格布局。当不考虑语义并且利用一些适当的嵌套和其他技巧,我们可以用table建立具有一定功能的布局。
然后是现在大多数人都在使用的浮动布局。我们可以使用任何我们想用的元素,但浮动并不适用于初学者。表面上它看起来很基础,但背后复杂的功能可以使经验丰富的开发">
<meta property="og:image" content="http://www.ruanyifeng.com/blogimg/asset/2015/bg2015071004.png">
<meta property="og:image" content="http://cdn.css-tricks.com/wp-content/uploads/2011/08/justify-contetnt.png">
<meta property="og:image" content="http://cdn.css-tricks.com/wp-content/uploads/2011/08/align-items.png">
<meta property="og:image" content="http://cdn.css-tricks.com/wp-content/uploads/2011/08/align-content.png">
<meta property="og:image" content="http://html-js.site/images/page/333.jpg">
<meta property="og:updated_time" content="2016-06-08T05:34:56.249Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Flex布局">
<meta name="twitter:description" content="flex测试工具
前言之前分享过Flex布局，一段时间没有用，忘得差不多了，恰逢我们的前端博客的诞生，在此记录并再次学习下；
布局方式首先,我们有表格布局。当不考虑语义并且利用一些适当的嵌套和其他技巧,我们可以用table建立具有一定功能的布局。
然后是现在大多数人都在使用的浮动布局。我们可以使用任何我们想用的元素,但浮动并不适用于初学者。表面上它看起来很基础,但背后复杂的功能可以使经验丰富的开发">
<meta name="twitter:image" content="http://www.ruanyifeng.com/blogimg/asset/2015/bg2015071004.png">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>




  <link rel="canonical" href="http://html-js.site/2016/05/10/Flex布局/"/>

  <title> Flex布局 | 前端-洋洋 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?ca98d1db5559cb59848d14443c7fa5dd";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">前端-洋洋</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">专注于前端</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Flex布局
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2016-05-10T17:31:17+08:00" content="2016-05-10">
              2016-05-10
            </time>
          </span>

          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2016/05/10/Flex布局/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2016/05/10/Flex布局/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><a href="/file/flexbox-playground/index.html" target="_blank">flex测试工具</a></p>
<h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>之前分享过Flex布局，一段时间没有用，忘得差不多了，恰逢我们的前端博客的诞生，在此记录并再次学习下；</p>
<h3 id="布局方式"><a href="#布局方式" class="headerlink" title="布局方式"></a>布局方式</h3><p>首先,我们有<b>表格布局</b>。当不考虑语义并且利用一些适当的嵌套和其他技巧,我们可以用table建立具有一定功能的布局。</p>
<p>然后是现在大多数人都在使用的<b>浮动布局</b>。我们可以使用任何我们想用的元素,但浮动并不适用于初学者。表面上它看起来很基础,但背后复杂的功能可以使经验丰富的开发者看着自己的屏幕不知所措。另外,浮动布局有一个缺点就是需要通过额外的元素清除浮动,或者更好一点,可以清除CSS浮动而不添加额外的标签。</p>
<p>这些缺点使得浮动布局不是很容易掌握，因为没有一个默认的方法可以建立起浮动与元素之间的关系，所以我们还需要更多的方法来实现<b>多栏等高布局</b></p>
<p>然后有些人开始使用<b>display: table，display: table-cell</b>等,但由于直到IE8 Internet Explorer浏览器才支持,人们似乎放弃了而只是接受float作为实际解决方案。</p>
<h3 id="弹性布局（Flex）的优势"><a href="#弹性布局（Flex）的优势" class="headerlink" title="弹性布局（Flex）的优势"></a>弹性布局（Flex）的优势</h3><ul>
<li>独立的高度控制与对齐</li>
<li>独立的元素顺序。</li>
<li>指定元素之间的关系。</li>
<li>灵活的尺寸和对齐方式。</li>
</ul>
<h2 id="Flex布局"><a href="#Flex布局" class="headerlink" title="Flex布局"></a>Flex布局</h2><h3 id="概念"><a href="#概念" class="headerlink" title="概念"></a>概念</h3><p>采用Flex布局的元素，称为Flex容器（flex container），简称”容器”。它的所有子元素自动成为容器成员，称为Flex项目（flex item），简称”项目”。</p>
<p>容器默认存在两根轴：水平的主轴（main axis）和垂直的交叉轴（cross axis）。主轴的开始位置（与边框的交叉点）叫做main start，结束位置叫做main end；交叉轴的开始位置叫做cross start，结束位置叫做cross end。<br>项目默认沿主轴排列。单个项目占据的主轴空间叫做main size，占据的交叉轴空间叫做cross size。<br><img width="571" height="341" src="http://www.ruanyifeng.com/blogimg/asset/2015/bg2015071004.png" alt="Down arrow"></p>
<h3 id="属性"><a href="#属性" class="headerlink" title="属性"></a>属性</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">display:flex | inline-flex; 定义弹性盒容器</span><br><span class="line">.box&#123;</span><br><span class="line">	display: -webkit-flex; /* Safari */</span><br><span class="line">	display: flex;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="定义弹性盒容器"><a href="#定义弹性盒容器" class="headerlink" title="定义弹性盒容器"></a>定义弹性盒容器</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">display:flex | inline-flex; </span><br><span class="line">flex-direction:row | row-reverse | column | column-reverse 定义主轴方向</span><br><span class="line">flex-wrap:nowrap | wrap | wrap-reverse 定义侧轴方向单行或多行</span><br><span class="line">flex-flow ‘flex-direction’ 和 ‘flex-wrap’的组合简写</span><br></pre></td></tr></table></figure>
<h3 id="定义主轴上子元素的排列方式"><a href="#定义主轴上子元素的排列方式" class="headerlink" title="定义主轴上子元素的排列方式"></a>定义主轴上子元素的排列方式</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">justify-content:flex-start | flex-end | center | space-between | space-around</span><br></pre></td></tr></table></figure>
<p><img width="500" height="320" src="http://cdn.css-tricks.com/wp-content/uploads/2011/08/justify-contetnt.png"></p>
<h3 id="定义侧轴上子元素高度的伸缩"><a href="#定义侧轴上子元素高度的伸缩" class="headerlink" title="定义侧轴上子元素高度的伸缩"></a>定义侧轴上子元素高度的伸缩</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">align-items:flex-start | flex-end | center | baseline | stretch</span><br></pre></td></tr></table></figure>
<p><img width="500" height="320" src="http://cdn.css-tricks.com/wp-content/uploads/2011/08/align-items.png" alt="Down arrow"></p>
<h3 id="定义侧轴上子元素的排列方式"><a href="#定义侧轴上子元素的排列方式" class="headerlink" title="定义侧轴上子元素的排列方式"></a>定义侧轴上子元素的排列方式</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">align-content:flex-start | flex-end | center | space-between | space-around | stretch</span><br></pre></td></tr></table></figure>
<p><img width="500" height="320" src="http://cdn.css-tricks.com/wp-content/uploads/2011/08/align-content.png" alt="Down arrow"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">order 子元素的显示顺序</span><br><span class="line">flex-grow 父元素拉伸时子元素的拉伸比例值</span><br><span class="line">flex-shrink 父元素缩小时子元素的收缩比例值</span><br><span class="line">flex-basis 子元素的初始显示比例值</span><br><span class="line">flex flex-grow [，flex-shrink，flex-basis]的简写形式</span><br><span class="line">align-self:auto | flex-start | flex-end | center | baseline | stretch 提供给单个子元素覆盖父元素align-items值的能力</span><br></pre></td></tr></table></figure>
<p>以上的CSS成为“新”的弹性盒模式,事实上，只有最近的几个Chrome内核（包括桌面版Chrome+、Android版Chrome、Opera 15+）支持这种写法，Firefox的支持还不够完善(详细信息点击这里)。更多的现代浏览器从几年前开始支持一种“老的”弹性盒模型语法，除了IE10。IE10似乎支持一种介于老语法与新语法之间的新语法。</p>
<p><img height="600" src="/images/page/333.jpg" alt="Down arrow"></p>
<h3 id="如果你将Flexbox多版本混合在一起使用，可以得到以下浏览器的支持："><a href="#如果你将Flexbox多版本混合在一起使用，可以得到以下浏览器的支持：" class="headerlink" title="如果你将Flexbox多版本混合在一起使用，可以得到以下浏览器的支持："></a>如果你将Flexbox多版本混合在一起使用，可以得到以下浏览器的支持：</h3><ul>
<li>Chrome any</li>
<li>Firefox any (android 上面好像有问题？)</li>
<li>Safari any</li>
<li>Opera 12.1+</li>
<li>IE 10+</li>
<li>iOS any</li>
<li>Android any</li>
</ul>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>虽然老版本的flex语法难以匹敌新版语法，但是仍然有很多支持广泛并且有用的特性。<br>像下面这样写CSS，可以方便的应用flex带来的排版上的方便。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">.f-f&#123;display: -webkit-box;display: -webkit-flex;&#125;</span><br><span class="line">.f-vc&#123;-webkit-box-align:center;-webkit-align-items:center;&#125;/*垂直居中*/</span><br><span class="line">.f-hc&#123;-webkit-box-pack:center;-webkit-justify-content:center;&#125;/*水平居中*/</span><br><span class="line">.f-hr&#123;-webkit-box-pack:end;-webkit-justify-content:flex-end;&#125;/*向右靠拢*/</span><br><span class="line">.f-hl&#123;-webkit-box-pack:start;-webkit-justify-content:flex-start;&#125;/*向左靠拢*/</span><br></pre></td></tr></table></figure>
<h3 id="将各种flex语法写成Sass："><a href="#将各种flex语法写成Sass：" class="headerlink" title="将各种flex语法写成Sass："></a>将各种flex语法写成Sass：</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">@mixin flexbox() &#123;</span><br><span class="line">	display: -webkit-box;</span><br><span class="line">	display: -moz-box;</span><br><span class="line">	display: -ms-flexbox;</span><br><span class="line">	display: -webkit-flex;</span><br><span class="line">	display: flex;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">@mixin flex($values) &#123;</span><br><span class="line">	-webkit-box-flex: $values;</span><br><span class="line">	-moz-box-flex:  $values;</span><br><span class="line">	-webkit-flex:  $values;</span><br><span class="line">	-ms-flex:  $values;</span><br><span class="line">	flex:  $values;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">@mixin order($val) &#123;</span><br><span class="line">	-webkit-box-ordinal-group: $val;  </span><br><span class="line">	-moz-box-ordinal-group: $val;     </span><br><span class="line">	-ms-flex-order: $val;     </span><br><span class="line">	-webkit-order: $val;  </span><br><span class="line">	order: $val;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h3><p><a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" target="_blank" rel="external">A Complete Guide to Flexbox</a></p>
<p><a href="http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html?utm_source=tuicool" target="_blank" rel="external">阮一峰-Flex 布局教程：语法篇</a></p>
<p><a href="http://my.oschina.net/yinyongcom666/blog/151085?p=NaN#OSC_h2_1" target="_blank" rel="external">Flex弹性布局在移动设备上的应用</a></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/wechat.jpg" alt="wangyang WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/alipay.jpg" alt="wangyang Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/flex/" rel="tag">#flex</a>
          
            <a href="/tags/css布局/" rel="tag">#css布局</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/05/10/前端资料汇总/" rel="next" title="前端资料汇总">
                <i class="fa fa-chevron-left"></i> 前端资料汇总
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/05/20/排序算法/" rel="prev" title="排序算法">
                排序算法 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2016/05/10/Flex布局/"
           data-title="Flex布局" data-url="http://html-js.site/2016/05/10/Flex布局/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/default_avatar.jpg"
               alt="wangyang" />
          <p class="site-author-name" itemprop="name">wangyang</p>
          <p class="site-description motion-element" itemprop="description">专注于前端</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">15</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">23</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/WangYang-Rex" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/u/2690568063/" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="617418875" target="_blank" title="QQ">
                  
                    <i class="fa fa-fw fa-qq"></i>
                  
                  QQ
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="mailto:617418875@qq.com" target="_blank" title="Mail">
                  
                    <i class="fa fa-fw fa-envelope-o"></i>
                  
                  Mail
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友链
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://http://moshui.site/" title="moxhuis" target="_blank">moxhuis</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://indexof.site/" title="indexof" target="_blank">indexof</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://xiaoqiang730730.github.io/" title="xiaoqiang" target="_blank">xiaoqiang</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#布局方式"><span class="nav-number">2.</span> <span class="nav-text">布局方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#弹性布局（Flex）的优势"><span class="nav-number">3.</span> <span class="nav-text">弹性布局（Flex）的优势</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Flex布局"><span class="nav-number"></span> <span class="nav-text">Flex布局</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#概念"><span class="nav-number">1.</span> <span class="nav-text">概念</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#属性"><span class="nav-number">2.</span> <span class="nav-text">属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#定义弹性盒容器"><span class="nav-number">3.</span> <span class="nav-text">定义弹性盒容器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#定义主轴上子元素的排列方式"><span class="nav-number">4.</span> <span class="nav-text">定义主轴上子元素的排列方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#定义侧轴上子元素高度的伸缩"><span class="nav-number">5.</span> <span class="nav-text">定义侧轴上子元素高度的伸缩</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#定义侧轴上子元素的排列方式"><span class="nav-number">6.</span> <span class="nav-text">定义侧轴上子元素的排列方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#如果你将Flexbox多版本混合在一起使用，可以得到以下浏览器的支持："><span class="nav-number">7.</span> <span class="nav-text">如果你将Flexbox多版本混合在一起使用，可以得到以下浏览器的支持：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#总结"><span class="nav-number"></span> <span class="nav-text">总结</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#将各种flex语法写成Sass："><span class="nav-number">1.</span> <span class="nav-text">将各种flex语法写成Sass：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考链接"><span class="nav-number">2.</span> <span class="nav-text">参考链接</span></a></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">wangyang</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.0.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"html-js"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/vendors/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  

</body>
</html>
